package com.wan.pojo;

import org.springframework.stereotype.Component;
//分页对象
@Component
public class Page {
    private int page;//当前页码
    private int rows;//每页显示条目
    private int offset;//对应数据库的偏移量

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getRows() {
        return rows;
    }

    public void setRows(int rows) {
        this.rows = rows;
    }

    public int getOffset() {
        this.offset = (page-1)*rows;//(比如每页显示20条，第一页是1~20，第二页是21~40.。。。)
        return offset;
    }

    public void setOffset(int offset) {
        this.offset=offset;
    }

}
